import { createRouter, createWebHistory } from 'vue-router'
import PageIndex from '../views/index.vue';
const routes = [
  {
    path:"/",
    component:PageIndex,
    redirect:"/login",
    children:[
      {
        path:"/home",
        name:"Home",
        component: () => import("../views/Home")
      },{
        path:"/list",
        name:"List",
        component: () => import("../views/List")
      },{
        path:"/editor",
        name:"Editor",
        component: () => import("../views/Editor")
      }
    ]
  },{
    path:"/register",
    name:"Register",
    component: () => import("../views/Register/index.vue")
  },{
    path:"/login",
    name:"Login",
    component: () => import("../views/Login/index.vue")
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
